

#pragma once



class CUpdateCheck
{
    public:
        CUpdateCheck();
        ~CUpdateCheck();

        void RunAutomatical();

        void DoModal();

        bool DownloadFile(CString& url, const CString& filename);

        bool CheckIfNewVersionAvailable(CString& downloadpath,DWORD& new_version);

        bool IsItTimeForUpdateCheck();

        void SetCheckedForUpdate();

    private:

        bool  mb_panic_break;

        CString  totad_checktime;

        static UINT __cdecl Threadfunction(LPVOID pParam);

        CWinThread* mp_running_thread;

        bool  DownloadAndInstall(CString& url);

        CString  mstr_final_run;
        CString  mstr_final_run_params;

};